# Celery入口文件
from celery import Celery
import os

# 配置django模块加载到运行环境中
if not os.getenv('DJANGO_SETTINGS_MODULE'):
    os.environ['DJANGO_SETTINGS_MODULE'] = 'rent_house.settings.dev'

# 创建Celery实例
celery_app = Celery('rent_house')
# 加载配置
celery_app.config_from_object('celery_tasks.config')

# 注册异步任务
celery_app.autodiscover_tasks(['celery_tasks.sms'])